from sqlalchemy import Column, Integer, String, func, DateTime, JSON, Boolean, ForeignKey
from sqlalchemy.orm import relationship

from models import Base


class Host(Base):
    """Host表"""
    id = Column(Integer, primary_key=True, index=True, autoincrement=True)
    name = Column(String(50), unique=True, nullable=False, comment='名称')
    host = Column(String(50), unique=True, nullable=False, comment='host')
    description = Column(String(200), comment='描述')
    createName = Column(String(20), nullable=False, comment='创建者')
    updateName = Column(String(20), comment='最后更新人')
    status = Column(Boolean, default=True, comment='状态')
    projectId = Column(Integer, ForeignKey('project.id', ondelete='CASCADE'), nullable=False, comment='项目ID')
